package tianrun.ziguan.api.calculate.config.service.cal.asset;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.multipart.MultipartFile;
import tianrun.ziguan.api.calculate.config.dto.request.*;
import tianrun.ziguan.api.calculate.config.dto.response.AssetNameBody;
import tianrun.ziguan.api.calculate.config.dto.response.AssetLabelDataBody;
import tianrun.ziguan.api.calculate.config.entity.TCalAsset;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * @author zhaoqi
 */
public interface ITCalAssetService extends IService<TCalAsset> {

    List<TCalAsset> queryAssetList(String assetGroupName);
    List<TCalAsset> queryAssetListByTemplateIds(Set<Long> ids);
    List<TCalAsset> queryChildAssets(String assetNum);

    List<TCalAsset> getByIds(Set<Long> ids);

    IPage<AssetLabelDataBody> getLabelData(AssetDataParam param);

    List<AssetNameBody> getAssetNameList(AssetNameParam param);

    /**
     * 批量保存或者修改(自动维护树形结构关系)
     */
    void saveOrUpdateBatchByGroup(Collection<TCalAsset> entityList);

    void addData(AddDataParam param, MultipartFile multipartFile) throws IOException;

    boolean updateTemplate(UpdateTemplateParam param);

    boolean clearData(ClearDataParam param);

    TCalAsset getByAssetNum(String assetNum);
}
